package com.bgds.sys.common.enums;

/**
 * 报警等级对应名称
 * @author lijiacheng
 * @date 2021-07-28
 */
public enum AlarmLogAlarmLevelEnum {

    ZERO(0, "正常"),
    ONE(1, "警告"),
    TWO(2, "严重警告"),
    THREE(3, "异常报警");

    private int code;
    private String value;

    AlarmLogAlarmLevelEnum(int code, String value) {
        this.code = code;
        this.value = value;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public static String getValueByCode(Integer code) {
        if (code == null) {
            return null;
        }
        for (AlarmLogAlarmLevelEnum ele : AlarmLogAlarmLevelEnum.values()) {
            if(ele.getCode() == code) {
                return ele.getValue();
            }
        }
        return null;
    }



}
